home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / libx11.lha / libX11 / xemul2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-22  |  13.6 KB  |  581 lines

  1. /* Copyright (c) 1996 by Terje Pedersen.  All Rights Reserved   */
  2. /*                                                              */
  3. /* By using this code you will agree to these terms:            */
  4. /*                                                              */
  5. /* 1. You may not use this code for profit in any way or form   */
  6. /*    unless an agreement with the author has been reached.     */
  7. /*                                                              */
  8. /* 2. The author is not responsible for any damages caused by   */
  9. /*    the use of this code.                                     */
  10. /*                                                              */
  11. /* 3. All modifications are to be released to the public.       */
  12. /*                                                              */
  13. /* Thats it! Have fun!                                          */
  14. /* TP                                                           */
  15. /*                                                              */
  16.  
  17. /***
  18.    NAME
  19.      xemul2
  20.    PURPOSE
  21.      
  22.    NOTES
  23.      
  24.    HISTORY
  25.      Terje Pedersen - Oct 22, 1994: Created.
  26. ***/
  27.  
  28. #include <intuition/intuition.h>
  29. #include <intuition/intuitionbase.h>
  30.  
  31. #include <graphics/gfx.h>
  32. #include <graphics/gfxbase.h>
  33. #include <graphics/gfxmacros.h>
  34. #include <graphics/displayinfo.h>
  35. #include <devices/timer.h>
  36.  
  37. #include <proto/intuition.h>
  38. #include <proto/graphics.h>
  39. #include <proto/gadtools.h>
  40. #include <proto/layers.h>
  41.  
  42. #include <dos.h>
  43. #include <signal.h>
  44. #include <stdlib.h>
  45. #include <time.h>
  46. #include <stdio.h>
  47.  
  48. #include "libX11.h"
  49.  
  50. #define XLIB_ILLEGAL_ACCESS 1
  51.  
  52. #include <X11/X.h>
  53. #include <X11/Xlib.h>
  54. #include <X11/Xutil.h>
  55. #include <X11/Intrinsic.h>
  56. #include <X11/IntrinsicP.h>
  57. #include <X11/CoreP.h>
  58.  
  59. #include <Xm/Xm.h>
  60. #include <Xm/Protocols.h>
  61. #include <Xm/Command.h>
  62. #include <Xm/MessageB.h>
  63. #include <Xm/FileSB.h>
  64. #include <Xm/Frame.h>
  65.  
  66. #include "amigax_proto.h"
  67. #include "amiga_x.h"
  68.  
  69. #define XMSTRINGDEFINES
  70.  
  71. XSetClassHint(display, w, class_hints)
  72.      Display *display;
  73.      Window w;
  74.      XClassHint *class_hints;
  75. {/*           File 'sunclock.o'*/
  76. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  77.   printf("WARNING: XSetClassHint\n");
  78. #endif
  79.   return(0);
  80. }
  81.  
  82. XSetCommand(display, w, argv, argc)
  83.      Display *display;
  84.      Window w;
  85.      char **argv;
  86.      int argc;
  87. {/*             File 'sunclock.o'*/
  88. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  89.   printf("WARNING: XSetCommand\n");
  90. #endif
  91.   return(0);
  92. }
  93.  
  94. XSetIconName(Display *d,Window w,char *iname){/*            File 'sunclock.o'*/
  95. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  96.   printf("WARNING: XSetIconName\n");
  97. #endif
  98.   return(0);
  99. }
  100.  
  101. int (*XSetErrorHandler(handler))()
  102.      int (* handler)(Display *, XErrorEvent *);
  103. {
  104. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  105.   printf("WARNING: XSetErrorHandler\n");
  106. #endif
  107.   return(0);
  108. }
  109.  
  110. XSetWMHints(display, w, wmhints)
  111.      Display *display;
  112.      Window w;
  113.      XWMHints *wmhints;
  114. {
  115. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  116.   printf("WARNING: XSetWMHints\n");
  117. #endif
  118.   return(0);
  119. }
  120. XSync(display, discard)
  121.      Display *display;
  122.      int discard;
  123. {
  124. /*  printf("XSync\n");*/
  125.   return(0);
  126. }
  127.  
  128. XGetErrorText(display, code, buffer_return, length)
  129.      Display *display;
  130.      int code;
  131.      char *buffer_return;
  132.      int length;
  133. {
  134. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  135.   printf("WARNING: XGetErrorText\n");
  136. #endif
  137.   return(0);
  138. }
  139.  
  140. void XmAddProtocolCallback (shell, property, protocol, callback, closure)
  141.      Widget      shell;
  142.      Atom        property;
  143.      Atom        protocol;
  144.      XtCallbackProc callback;
  145.      XtPointer   closure;
  146. {/*   File 'motifutils.o'*/
  147. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  148.   printf("WARNING: XmAddProtocolCallback\n");
  149. #endif
  150.   return(0);
  151. }
  152.  
  153. Widget XmCommandGetChild (widget, child)
  154.      Widget    widget;
  155.      unsigned char child;
  156. {/*       File 'comwin.o'*/
  157. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  158.   printf("WARNING: XmCommandGetChild\n");
  159. #endif
  160.   return(0);
  161. }
  162.  
  163. Widget XmCreateCommand (parent, name, arglist, argcount)
  164.      Widget    parent;
  165.      String    name;
  166.      ArgList   arglist;
  167.      Cardinal  argcount;
  168. {/*         File 'comwin.o'*/
  169. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  170.   printf("WARNING: XmCreateCommand\n");
  171. #endif
  172.   return(0);
  173. }
  174.  
  175. Widget XmCreateDialogShell (parent, name, arglist, argcount)
  176.      Widget    parent;
  177.      String    name;
  178.      ArgList   arglist;
  179.      Cardinal  argcount;
  180. {/*     File 'fileswin.o'*/
  181. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  182.   printf("WARNING: XmCreateDialogShell\n");
  183. #endif
  184.   return(0);
  185. }
  186.  
  187.       Widget XmCreateErrorDialog (parent, name, arglist, argcount)
  188.            Widget    parent;
  189.            String    name;
  190.            ArgList   arglist;
  191.            Cardinal  argcount;
  192. {/*     File 'malerts.o'*/
  193. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  194.   printf("WARNING: XmCreateErrorDialog\n");
  195. #endif
  196.   return(0);
  197. }
  198.  
  199. Widget XmCreateFrame (parent, name, arglist, argcount)
  200.      Widget    parent;
  201.      String    name;
  202.      ArgList   arglist;
  203.      Cardinal  argcount;
  204. {/*           File 'fileswin.o'*/
  205. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  206.   printf("WARNING: XmCreateFrame\n");
  207. #endif
  208.   return(0);
  209. }
  210.  
  211. XmCreateLabelGadget(){/*     File 'fileswin.o'*/
  212. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  213.   printf("WARNING: XmCreateLabelGadget\n");
  214. #endif
  215.   return(0);
  216. }
  217.  
  218. #include <Xm/MainW.h>
  219.  
  220. Widget XmCreateMainWindow (parent, name, arglist, argcount)
  221.      Widget    parent;
  222.      String    name;
  223.      ArgList   arglist;
  224.      Cardinal  argcount;
  225. {/*      File 'xmgr.o'*/
  226. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  227.   printf("WARNING: XmCreateMainWindow\n");
  228. #endif
  229.   return(0);
  230. }
  231.  
  232. #include <Xm/RowColumn.h>
  233.  
  234.  
  235. #include <Xm/RowColumn.h>
  236.  
  237. Widget XmCreateOptionMenu (parent, name, arglist, argcount)
  238.      Widget    parent;
  239.      String    name;
  240.      ArgList   arglist;
  241.      Cardinal  argcount;
  242. {/*      File 'motifutils.o'*/
  243. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  244.   printf("WARNING: XmCreateOptionMenu\n");
  245. #endif
  246.   return(0);
  247. }
  248.  
  249. #include <Xm/RowColumn.h>
  250.  
  251. #include <Xm/PushBG.h>
  252.  
  253. Widget XmCreatePushButtonGadget (parent, name, arglist, argcount)
  254.      Widget    parent;
  255.      String    name;
  256.      ArgList   arglist;
  257.      Cardinal  argcount;
  258. {/* File 'motifutils.o'*/
  259. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  260.   printf("WARNING: XmCreatePushButtonGadget\n");
  261. #endif
  262.   return(0);
  263. }
  264.  
  265. #include <Xm/RowColumn.h>
  266.  
  267. Widget XmCreateRadioBox (parent, name, arglist, argcount)
  268.      Widget    parent;
  269.      String    name;
  270.      ArgList   arglist;
  271.      Cardinal  argcount;
  272. {/*        File 'fileswin.o'*/
  273. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  274.   printf("WARNING: XmCreateRadioBox\n");
  275. #endif
  276.   return(0);
  277. }
  278.  
  279. #include <Xm/Xm.h>
  280. #include <Xm/AtomMgr.h>
  281.  
  282. Atom XmInternAtom (display, name, only_if_exists)
  283.      Display   * display;
  284.      String    name;
  285.      Boolean   only_if_exists;
  286. {/*            File 'motifutils.o'*/
  287. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  288.   printf("WARNING: XmInternAtom\n");
  289. #endif
  290.   return(0);
  291. }
  292.  
  293. #include <Xm/List.h>
  294.  
  295. void XmListAddItemsUnselected (widget, items, item_count, position)
  296.      Widget    widget;
  297.      XmString  *items;
  298.      int       item_count;
  299.      int       position;
  300. {/* File 'comwin.o'*/
  301. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  302.   printf("WARNING: XmListAddItemUnselected\n");
  303. #endif
  304.   return(0);
  305. }
  306.  
  307. #include <Xm/List.h>
  308.  
  309. void XmListDeletePos (widget, position)
  310.      Widget    widget;
  311.      int       position;
  312. {/*         File 'comwin.o'*/
  313. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  314.   printf("WARNING: XmListDeletePos\n");
  315. #endif
  316.   return(0);
  317. }
  318.  
  319. #include <Xm/MainW.h>
  320.  
  321. void XmMainWindowSetAreas (widget, menu_bar, command_window,
  322.                horizontal_scrollbar, vertical_scrollbar, work_region)
  323.      Widget    widget;
  324.      Widget    menu_bar;
  325.      Widget    command_window;
  326.      Widget    horizontal_scrollbar;
  327.      Widget    vertical_scrollbar;
  328.      Widget    work_region;
  329. {/*    File 'xmgr.o'*/
  330. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  331.   printf("WARNING: XmMainWindowSetAreas\n");
  332. #endif
  333.   return(0);
  334. }
  335.  
  336. #include <Xm/MessageB.h>
  337.  
  338. Widget XmMessageBoxGetChild (widget, child)
  339.      Widget    widget;
  340.      unsigned char child;
  341. {/*    File 'malerts.o'*/
  342. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  343.   printf("WARNING: XmMessageBoxGetChild\n");
  344. #endif
  345.   return(0);
  346. }
  347.  
  348. #include <Xm/Text.h>
  349.  
  350. XmTextPosition XmTextGetLastPosition (widget)
  351.      Widget    widget;
  352. {/*   File 'monwin.o'*/
  353. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  354.   printf("WARNING: XmTextGetLastPosition\n");
  355. #endif
  356.   return(0);
  357. }
  358.  
  359. char *XmTextGetString(Widget widget){/*         File 'monwin.o'*/
  360. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  361.   printf("WARNING: XmTextGetString\n");
  362. #endif
  363.   return(0);
  364. }
  365.  
  366. void XmTextInsert(Widget widget,XmTextPosition position,char *value)
  367. {/*            File 'monwin.o'*/
  368. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  369.     printf("WARNING: XmTextInsert\n");
  370. #endif
  371.     return(0);
  372. }
  373.  
  374. void XmTextSetTopCharacter(Widget widget,XmTextPosition top_character)
  375. {/*   File 'monwin.o'*/
  376. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  377.   printf("WARNING: XmTextSetTopCharacter\n");
  378. #endif
  379.   return(0);
  380. }
  381.  
  382. void XmUpdateDisplay(Widget w){/*         File 'xmgr.o'*/
  383. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  384.   printf("WARNING: XmUpdateDisplay\n");
  385. #endif
  386.   return(0);
  387. }
  388.  
  389. WidgetClass xmCascadeButtonWidgetClass;
  390. WidgetClass xmDrawingAreaWidgetClass;
  391. WidgetClass xmFrameWidgetClass;
  392. WidgetClass xmLabelGadgetClass;
  393. WidgetClass xmLabelWidgetClass;
  394. WidgetClass xmPushButtonGadgetClass;
  395. WidgetClass xmPushButtonWidgetClass;
  396. WidgetClass xmRowColumnWidgetClass;
  397. WidgetClass xmScaleWidgetClass;
  398. WidgetClass xmScrolledWindowWidgetClass;
  399. WidgetClass xmSeparatorGadgetClass;
  400. WidgetClass xmTextFieldWidgetClass;
  401. WidgetClass xmTextWidgetClass;
  402. WidgetClass xmToggleButtonGadgetClass;
  403.  
  404. void cfree(char *data){/*                   File 'compwin.o'*/
  405.   free(data);
  406. }
  407.  
  408. double hypot(double x,double y){/*                   File 'events.o'*/
  409.   double sq;
  410. /*  printf("hypot %f %f\n",x,y);*/
  411.   sq=(double)(sqrt(x*x+y*y));
  412. /*  printf("sqrt %f\n",sq);*/
  413.   return(sq);
  414. }
  415.  
  416. /*
  417. nonl(){/*_parms              File 'nonlwin.o'*/
  418.   printf("nonl\n");
  419.   return(0);
  420. }
  421. */
  422.  
  423. int XGetWindowProperty(display, w, property, long_offset,
  424.                long_length, delete, req_type, actual_type_return,
  425.                actual_format_return, nitems_return, bytes_after_return,
  426.                prop_return)
  427.      Display *display;
  428.      Window w;
  429.      Atom property;
  430.      long long_offset, long_length;
  431.      Bool delete;
  432.      Atom req_type;
  433.      Atom *actual_type_return;
  434.      int *actual_format_return;
  435.      unsigned long *nitems_return;
  436.      unsigned long *bytes_after_return;
  437.      unsigned char **prop_return;
  438. {/*      File 'xdaliclock.o'*/
  439. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  440.   printf("WARNING: XGetWindowProperty\n");
  441. #endif
  442.   return(0);
  443. }
  444.  
  445. double erf(double x){
  446.   printf("erf? %f\n",x);
  447.   return(x);
  448. }
  449.  
  450. double erfc(double x){
  451.   printf("erfc? %f\n",x);
  452.   return(x);
  453. }
  454.  
  455. double lgamma(double x){
  456.   printf("lgamma? %f\n",x);
  457.   return(x);
  458. }
  459.  
  460. XrmDatabase XrmGetDatabase(display)
  461.      Display *display;
  462. {/*          File 'magick/libMagick.lib' */
  463. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  464.   printf("WARNING: XrmGetDatabase\n");
  465. #endif
  466.   return(0);
  467. }
  468.  
  469. Window XGetSelectionOwner(display, selection)
  470.      Display *display;
  471.      Atom selection;
  472. {/*      File 'magick/libMagick.lib' */
  473. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  474.   printf("WARNING: XGetSelectionOwner\n");
  475. #endif
  476.   return(0);
  477. }
  478.  
  479. XGetIconSizes(){/*           File 'magick/libMagick.lib' */
  480. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  481.   printf("WARNING: XGetIconSizes\n");
  482. #endif
  483.   return(0);
  484. }
  485.  
  486. void XrmCombineDatabase(source_db, target_db, override)
  487.      XrmDatabase source_db;
  488.      XrmDatabase *target_db;
  489.      Bool override;
  490. {/*      File 'magick/libMagick.lib' */
  491. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  492.   printf("WARNING: XrmCombineDatabase\n");
  493. #endif
  494.   return(0);
  495. }
  496.  
  497. Status XStringListToTextProperty(list, count, text_prop_return)
  498.      char **list;
  499.      int count;
  500.      XTextProperty *text_prop_return;
  501. {
  502.   text_prop_return->value=*list;
  503.   text_prop_return->format=8;
  504.   text_prop_return->nitems=1;
  505.   return(1);
  506. }
  507.  
  508. XrmCombineFileDatabase(){/*  File 'magick/libMagick.lib' */
  509. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  510.   printf("WARNING: XrmCombineFileDatabase\n");
  511. #endif
  512.   return(0);
  513. }
  514.  
  515. XBitmapPad(){/*              File 'magick/libMagick.lib' */
  516. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  517.   printf("WARNING: XBitmapPad\n");
  518. #endif
  519.   return(0);
  520. }
  521.  
  522. void XrmPutFileDatabase(database, stored_db)
  523.      XrmDatabase database;
  524.      char *stored_db;
  525. {/*      File 'magick/libMagick.lib' */
  526. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  527.   printf("WARNING: XrmPutFileDatabase\n");
  528. #endif
  529.   return(0);
  530. }
  531.  
  532. XConvertSelection(){/*       File 'magick/libMagick.lib' */
  533. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  534.   printf("WARNING: XConvertSelection\n");
  535. #endif
  536.   return(0);
  537. }
  538.  
  539. Status XGetCommand(display, w, argv_return, argc_return)
  540.      Display *display;
  541.      Window w;
  542.      char ***argv_return;
  543.      int *argc_return;
  544. {/*             File 'display.o' */
  545. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  546.   printf("WARNING: XGetCommand\n");
  547. #endif
  548.   return(0);
  549. }
  550.  
  551. void XFreeStringList(list)
  552.      char **list;
  553. {/*         File 'display.o' */
  554. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  555.   printf("WARNING: XFreeStringList\n");
  556. #endif
  557.   return(0);
  558. }
  559.  
  560. XtErrorHandler XtAppSetErrorHandler(app_context, handler)
  561.      XtAppContext app_context;
  562.      XtErrorHandler handler;
  563. {
  564. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  565.   printf("WARNING: XtAppSetErrorHandler\n");
  566. #endif
  567.   return(0);
  568. }
  569.  
  570. XtWorkProcId XtAppAddWorkProc(app_context, proc, client_data)
  571.      XtAppContext app_context;
  572.      XtWorkProc proc;
  573.      XtPointer client_data;
  574.  
  575. {
  576. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  577.   printf("WARNING: XtAppAddWorkProc\n");
  578. #endif
  579.   return(0);
  580. }
  581.